<?php

class GAction extends CommonAction
{
	private $_description = array ('1' => '金币+1', '-1' => '重复看视频~金币不加1', '-2' => '视频ID不合法');
	
	// 看视频获取金币
	public function setGolds(){
		$_u['u_golds'] = $_REQUEST['g'];
		if(!$this->Core->User->u_id){
			echo '请先登录';
		}elseif($_u['u_golds']<0){
			echo '金币太少';
		}elseif(!is_numeric($_u['u_golds'])){
			echo '金币不是数字么？';
		}else{
			M('User')->where(array('u_id'=>$this->Core->User->u_id))->data($_u)->save();
			echo "金币变成了:".$_u['u_golds'];
		}
		
	}
	





}
?>